package com.fuershiye.woman.monitor.service;

import java.util.List;

import com.fuershiye.woman.monitor.beans.IdAreaId;
import com.fuershiye.woman.monitor.beans.IdNameArea;
import com.fuershiye.woman.monitor.beans.IdNameSname;
import com.fuershiye.woman.monitor.beans.Page;
import com.fuershiye.woman.monitor.model.Department;

/**
 * @author yongyongdong
 *
 */
public interface DepartmentService {

    public void save(Department department);
    
    /**
     * @param name	部门名称,简称,代码(code)模糊查询
     * @param type	部门类型(null为全部)
     * @param level	部门级别(null为全部)
     * @param status	0:删除; 1:正常; null:全部
     * @param page	页码数
     * @return
     */
    public List<Department> list(String name, Long type, Integer level, Integer status, Page page);

    public List<Department> listByLevel(Integer level, Integer status);
    
    public int getTotal(String name, Long type, Integer level, Integer status);
    
    public List<IdNameArea> listByPidOrArea(Long pid, Long area);
    
    public Department get(Long id);
    public IdNameSname find(Long id);
    
    public Department findByAreaAndType(Long areaid, Long type);

    public void delete(Long id);

    public Department findByUserName(String userName);

    /**
     * 获取所有的类型(id和部门简称)
     * 
     * @return
     */
    public List<IdNameSname> getAllSnames(Integer level, Long type, Integer status);
    public List<IdAreaId> getAllIdAreaId();
    
    public List<IdNameSname> getAllSnames();
    
    public List<IdNameSname> getAllByLevelAndArea(Integer level, Long areaid, int status);
    
    public List<Long> getDepartIdsFromIdNameSname(List<IdNameSname> departmentList);
    
    public List<Long> getDepartIds(List<Department> departmentList);

    public List<Long> getIdsByCondition(Integer level, int status);
    
}
